#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>

int main()
{
	int sockfd = socket(AF_INET , SOCK_DGRAM , 0);
	struct sockaddr_in addr;
	addr.sin_family = AF_INET ;
	addr.sin_port = htons(2345);
	addr.sin_addr.s_addr = inet_addr("192.168.118.129");
	int res = bind(sockfd , (struct sockaddr*)&addr , sizeof(addr));
	if(res == -1)
		perror("bind") ,exit(-1);
	printf("bind...");
	char buf[200] = {};
	while(1)
	{
		res = read(sockfd , buf , sizeof(buf));
		printf("read %d bytes , content : %s\n",res,buf);		
	}
	close(sockfd);
}
